#pragma once

typedef enum padding{
    No_Padding = 0      ,   // 不填充，那就只能加密长度为加密组的倍数，一般不使用
    Zeros_Padding = 1   ,   // 补0，如果原数据长度恰好是16的倍数，也要补16个0
    ISO10126_Padding = 2,   // 最后一个字节是填充的字节数（包括最后一字节），其他全部填随机数。 数据： FF FF FF FF FF FF FF FF 填充： FF FF FF FF FF FF FF FF FF 7D 2A 75 EF F8 EF 07
    PKCS7_Padding = 3   ,   // 最后一组缺几个字节就填充几,与PKCS#5相同
    ANSI_X923_Padding = 4,  // 类似于PKCS#7，但除了最后一个字节（表示填充字节数）外，其余填充字节都为0
    ISO7816_4_Padding = 5,  // 第一个填充字节为0x80，之后的所有填充字节为0x00，直到达到块大小
} padding_t;

unsigned int AddPKCS7Padding(unsigned char *data, unsigned int data_len, unsigned char block_size);
unsigned int DelPKCS7Padding(unsigned char *data, unsigned int data_len, unsigned char block_size);
unsigned int AddZeroPadding(unsigned char *data, unsigned int data_len, unsigned char block_size);
unsigned int DelZeroPadding(unsigned char *data, unsigned int data_len, unsigned char block_size);
unsigned int AddISO10126Padding(unsigned char *data, unsigned int data_len, unsigned char block_size);
unsigned int DelISO10126Padding(unsigned char *data, unsigned int data_len, unsigned char block_size);
unsigned int AddISO7816Padding(unsigned char *data, unsigned int data_len, unsigned char block_size);
unsigned int DelISO7816Padding(unsigned char *data, unsigned int data_len, unsigned char block_size);
unsigned int AddANSIX923Padding(unsigned char *data, unsigned int data_len, unsigned char block_size);
unsigned int DelANSIX923Padding(unsigned char *data, unsigned int data_len, unsigned char block_size);
